POV-Ray : Newsgroups : povray.windows : Pov-ray Help! colors : Re: Pov-ray Help! colors Server Time
5 Jul 2024 07:39:51 EDT (-0400)
  Re: Pov-ray Help! colors  
From: bob h
Date: 1 Jun 2002 09:00:00
Message: <3cf8c550@news.povray.org>
"maheshtd" <mah### [at] onetelnetuk> wrote in message
news:3cf89b4f@news.povray.org...
> There is one problem with pov-ray for me. I seem to be stuck on this
problem
> i tried solving it and i couldn't. When you declare colors in rgb
<1,0,0> }
> inside the brackets. How do i find a color using this statement or other
> colors. I want to create a background from light blue to dark blue, the
sky.
> It just dosen't seem to work  Also is there a way of finding out which
color
> is which when you use the rgb statement above.

Basically, no. Only if a database were created first and the values matched
names in the database (array? file?).

Colors are created in the following way:

rgb <0,1,1> is cyan or a light blue. rgb <0,0,1> would be medium blue, and
rgb <0,0,0.5> might be called a dark blue. That's only my idea of those
though, you could get color numbers from a web style color coding and
convert to RGB since those often have names for them.

Also, if you want to get the values later on in a scene file you can do this
(I realize though that you might not be interested in this kind of thing):

#declare LtBlu=<0,1,1>;

Then like:

pigment {color rgb LtBlu.z} // only the blue
pigment {color rgb LtBlu.y+LtBlu.z} // both green and blue (light blue)

Or like:

#declare PartBlue=LtBlu.z

Maybe you understand what I'm saying, those are dot operators so you can
look up those words in the docs and find out more.

Back to what you were actually asking about the shaded coloration for sky...
You need a "blend" map, which is done in the following way:

sky_sphere {
pigment {
    gradient y // pattern going up and down
        color_map { // the blending colors below
            [0 color rgb <0,1,1>] // lighter horizon
            [1 color rgb <0,0,1>] // darker zenith
            }
// this makes a horizon line which is also the dark color below y*0
// to make it another way you need to add scale translate or a wave form.
        }
}

Those colors can be anything, of course. For instance, <0.4,0.8,1.0> and
<0.3,0.6,0.9>.

For color names with RGB values have a look at
http://sed.ucsd.edu/escowles/rgb.html
There are many such places to be found on the web. Main idea is to use the 0
to 255 decimal value for each x, y, z of the rgb vector (<r,g,b>) and divide
by 255 to get 0 to 1 that POV interpretes as the color. Example: color rgb
<0,191,255>/255 is deep sky blue as on that web page.

bob h


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.